﻿import instance from '../axios/index.js'
export function channelTime(sss) { //channel页面时间安排
  return new Promise((resolve, reject) => {
    instance.post('api/ykPc/list', sss, { //'/本地 把'/YK/api 替换成'/api  线上反之
      headers: {
        'content-type': 'application/x-www-form-urlencoded',
      }
    }).then((res) => {
      resolve(res)
    }).catch((err) => {
      reject(err)
    })
  })
}

//作业上传
export function submitPoForm(sss) { 
  return new Promise((resolve, reject) => {
    instance.post('api/ykZuoye/add', sss, { 
      headers: {
        'content-type': 'application/x-www-form-urlencoded',
      }
    }).then((res) => {
      resolve(res)
    }).catch((err) => {
      reject(err)
    })
  })
}
//免费试听 
export function FreeCourse(sss) { 
  return new Promise((resolve, reject) => {
    instance.post('api/ykAuthor/teacherfreecourse', sss, { 
      headers: {
        'content-type': 'application/x-www-form-urlencoded',
      }
    }).then((res) => {
      resolve(res)
    }).catch((err) => {
      reject(err)
    })
  })
}
// 艺考资料 
export function yikaoziliao(sss) { 
  return new Promise((resolve, reject) => {
    instance.post('api/ykZhiliao/list', sss, { 
      headers: {
        'content-type': 'application/x-www-form-urlencoded',
      }
    }).then((res) => {
      resolve(res)
    }).catch((err) => {
      reject(err)
    })
  })
}
// 资料详情
export function yikaoziliaoDetail(sss) { //channel页面免费试听
  return new Promise((resolve, reject) => {
    instance.post('api/ykZhiliao/info', sss, { 
      headers: {
        'content-type': 'application/x-www-form-urlencoded',
      }
    }).then((res) => {
      resolve(res)
    }).catch((err) => {
      reject(err)
    })
  })
}
export function rotationChart2(sss) { //轮播图
  return new Promise((resolve, reject) => {
    instance.post('api/rotationChart/getShow2', sss, { 
      headers: {
        'content-type': 'application/x-www-form-urlencoded',
      }
    }).then((res) => {
      resolve(res)
    }).catch((err) => {
      reject(err)
    })
  })
}

/**
 * 
 * 
 * 旧接口
 * 
 * 
 */



export function rotationChart(sss) { //轮播图
  return new Promise((resolve, reject) => {
    instance.post('api/rotationChart/getShow1', sss, { //'/本地 把'/api 替换成'/api  线上反之
      headers: {
        'content-type': 'application/x-www-form-urlencoded',
      }
    }).then((res) => {
      resolve(res)
    }).catch((err) => {
      reject(err)
    })
  })
}


export function ykUserAddr(sss) { //地址列表
  return new Promise((resolve, reject) => {
    instance.post('api/ykUserAddr/list', sss, {
      headers: {
        'content-type': 'application/x-www-form-urlencoded',
      }
    }).then((res) => {
      resolve(res)
    }).catch((err) => {
      reject(err)
    })
  })
}
export function removeAddr(sss) { //删除地址
  return new Promise((resolve, reject) => {
    instance.post('api/ykUserAddr/remove', sss, {
      headers: {
        'content-type': 'application/x-www-form-urlencoded',
      }
    }).then((res) => {
      resolve(res)
    }).catch((err) => {
      reject(err)
    })
  })
}
export function addAddr(sss) { //添加地址
  return new Promise((resolve, reject) => {
    instance.post('api/ykUserAddr/add', sss, {
      headers: {
        'content-type': 'application/x-www-form-urlencoded',
      }
    }).then((res) => {
      resolve(res)
    }).catch((err) => {
      reject(err)
    })
  })
}
export function editAddr(sss) { //修改地址
  return new Promise((resolve, reject) => {
    instance.post('api/ykUserAddr/edit', sss, {
      headers: {
        'content-type': 'application/x-www-form-urlencoded',
      }
    }).then((res) => {
      resolve(res)
    }).catch((err) => {
      reject(err)
    })
  })
}
export function send_message(sss) { //发送验证码
  return new Promise((resolve, reject) => {
    instance.post('api/ykUser/send-message', sss, {
      headers: {
        'content-type': 'application/x-www-form-urlencoded',
      }
    }).then((res) => {
      resolve(res)
    }).catch((err) => {
      reject(err)
    })
  })
}
export function register(sss) { //注册
  return new Promise((resolve, reject) => {
    instance.post('api/ykUser/register', sss, {
      headers: {
        'content-type': 'application/x-www-form-urlencoded',
      }
    }).then((res) => {
      resolve(res)
    }).catch((err) => {
      reject(err)
    })
  })
}
export function yanzlogin(sss) { //验证码登录
  return new Promise((resolve, reject) => {
    instance.post('api/ykUser/yanzlogin', sss, {
      headers: {
        'content-type': 'application/x-www-form-urlencoded',
      }
    }).then((res) => {
      resolve(res)
    }).catch((err) => {
      reject(err)
    })
  })
}
export function mmlogin(sss) { //密码登录
  return new Promise((resolve, reject) => {
    instance.post('api/ykUser/login', sss, {
      headers: {
        'content-type': 'application/x-www-form-urlencoded',
      }
    }).then((res) => {
      resolve(res)
    }).catch((err) => {
      reject(err)
    })
  })
}
export function forgetmm(sss) { //忘记密码
  return new Promise((resolve, reject) => {
    instance.post('api/ykUser/passwordBack', sss, {
      headers: {
        'content-type': 'application/x-www-form-urlencoded',
      }
    }).then((res) => {
      resolve(res)
    }).catch((err) => {
      reject(err)
    })
  })
}
export function info(sss) { //用户信息
  return new Promise((resolve, reject) => {
    instance.post('api/ykUser/info', sss, {
      headers: {
        'content-type': 'application/x-www-form-urlencoded',
      }
    }).then((res) => {
      resolve(res)
    }).catch((err) => {
      reject(err)
    })
  })
}
export function outlogin(sss) { //用户信息
  return new Promise((resolve, reject) => {
    instance.post('api/ykUser/exit', sss, {
      headers: {
        'content-type': 'application/x-www-form-urlencoded',
      }
    }).then((res) => {
      resolve(res)
    }).catch((err) => {
      reject(err)
    })
  })
}
export function mationlist(sss) { //资讯列表  首页头条
  return new Promise((resolve, reject) => {
    instance.post('api/ykInformation/list', sss, {
      headers: {
        'content-type': 'application/x-www-form-urlencoded',
      }
    }).then((res) => {
      resolve(res)
    }).catch((err) => {
      reject(err)
    })
  })
}
export function formationTypelist(sss) { //资讯分类列表
  return new Promise((resolve, reject) => {
    instance.post('api/ykInformationType/list', sss, {
      headers: {
        'content-type': 'application/x-www-form-urlencoded',
      }
    }).then((res) => {
      resolve(res)
    }).catch((err) => {
      reject(err)
    })
  })
}
export function formationinfo(sss) { //资讯详情
  return new Promise((resolve, reject) => {
    instance.post('api/ykInformation/info', sss, {
      headers: {
        'content-type': 'application/x-www-form-urlencoded',
      }
    }).then((res) => {
      resolve(res)
    }).catch((err) => {
      reject(err)
    })
  })
}
export function formationtuijian(sss) { //资讯推荐
  return new Promise((resolve, reject) => {
    instance.post('api/ykInformation/tuijian', sss, {
      headers: {
        'content-type': 'application/x-www-form-urlencoded',
      }
    }).then((res) => {
      resolve(res)
    }).catch((err) => {
      reject(err)
    })
  })
}
export function Professionallist(sss) { //专业分类
  return new Promise((resolve, reject) => {
    instance.post('api/ykProfessional/list', sss, {
      headers: {
        'content-type': 'application/x-www-form-urlencoded',
      }
    }).then((res) => {
      resolve(res)
    }).catch((err) => {
      reject(err)
    })
  })
}
export function ykGoodslist(sss) { //专业商品
  return new Promise((resolve, reject) => {
    instance.post('api/ykGoods/list', sss, {
      headers: {
        'content-type': 'application/x-www-form-urlencoded',
      }
    }).then((res) => {
      resolve(res)
    }).catch((err) => {
      reject(err)
    })
  })
}
export function ykGoodsinfo(sss) { //专业商品详情
  return new Promise((resolve, reject) => {
    instance.post('api/ykGoods/info', sss, {
      headers: {
        'content-type': 'application/x-www-form-urlencoded',
      }
    }).then((res) => {
      resolve(res)
    }).catch((err) => {
      reject(err)
    })
  })
}
export function ykSchoollist(sss) { //高校简章list
  return new Promise((resolve, reject) => {
    instance.post('api/ykSchool/list', sss, {
      headers: {
        'content-type': 'application/x-www-form-urlencoded',
      }
    }).then((res) => {
      resolve(res)
    }).catch((err) => {
      reject(err)
    })
  })
}
export function ykSchoolinfo(sss) { //高校detail
  return new Promise((resolve, reject) => {
    instance.post('api/ykSchool/info', sss, {
      headers: {
        'content-type': 'application/x-www-form-urlencoded',
      }
    }).then((res) => {
      resolve(res)
    }).catch((err) => {
      reject(err)
    })
  })
}
export function ykSchoolNewlist(sss) { //高校detailxinwen
  return new Promise((resolve, reject) => {
    instance.post('api/ykSchoolNew/list', sss, {
      headers: {
        'content-type': 'application/x-www-form-urlencoded',
      }
    }).then((res) => {
      resolve(res)
    }).catch((err) => {
      reject(err)
    })
  })
}
export function ykSchoolNewinfo(sss) { //高校detailxinwen详情
  return new Promise((resolve, reject) => {
    instance.post('api/ykSchoolNew/info', sss, {
      headers: {
        'content-type': 'application/x-www-form-urlencoded',
      }
    }).then((res) => {
      resolve(res)
    }).catch((err) => {
      reject(err)
    })
  })
}
export function ykAuthorlist(sss) { //教师列表
  return new Promise((resolve, reject) => {
    instance.post('api/ykAuthor/list', sss, {
      headers: {
        'content-type': 'application/x-www-form-urlencoded',
      }
    }).then((res) => {
      resolve(res)
    }).catch((err) => {
      reject(err)
    })
  })
}
export function ykAuthorinfo(sss) { //教师详情
  return new Promise((resolve, reject) => {
    instance.post('api/ykAuthor/info', sss, {
      headers: {
        'content-type': 'application/x-www-form-urlencoded',
      }
    }).then((res) => {
      resolve(res)
    }).catch((err) => {
      reject(err)
    })
  })
}
export function booktuijian(sss) { //选课 图书 推荐
  return new Promise((resolve, reject) => {
    instance.post('api/ykGoods/booktuijian', sss, {
      headers: {
        'content-type': 'application/x-www-form-urlencoded',
      }
    }).then((res) => {
      resolve(res)
    }).catch((err) => {
      reject(err)
    })
  })
}
export function addcar(sss) { //添加购物车
  return new Promise((resolve, reject) => {
    instance.post('api/ykCart/add', sss, {
      headers: {
        'content-type': 'application/x-www-form-urlencoded',
      }
    }).then((res) => {
      resolve(res)
    }).catch((err) => {
      reject(err)
    })
  })
}
export function cart(sss) { //购物车
  return new Promise((resolve, reject) => {
    instance.post('api/ykCart/list', sss, {
      headers: {
        'content-type': 'application/x-www-form-urlencoded',
      }
    }).then((res) => {
      resolve(res)
    }).catch((err) => {
      reject(err)
    })
  })
}
export function ykCartedit(sss) { //修改购物车数量
  return new Promise((resolve, reject) => {
    instance.post('api/ykCart/edit', sss, {
      headers: {
        'content-type': 'application/x-www-form-urlencoded',
      }
    }).then((res) => {
      resolve(res)
    }).catch((err) => {
      reject(err)
    })
  })
}
export function removecart(sss) { //删除购物车
  return new Promise((resolve, reject) => {
    instance.post('api/ykCart/remove', sss, {
      headers: {
        'content-type': 'application/x-www-form-urlencoded',
      }
    }).then((res) => {
      resolve(res)
    }).catch((err) => {
      reject(err)
    })
  })
}
export function ykGoodscourses(sss) { //创建订单
  return new Promise((resolve, reject) => {
    instance.post('api/ykOrder/courses', sss, {
      headers: {
        'content-type': 'application/x-www-form-urlencoded',
      }
    }).then((res) => {
      resolve(res)
    }).catch((err) => {
      reject(err)
    })
  })
}
export function ykOrderappOrder(sss) { //创建订单支付
  return new Promise((resolve, reject) => {
    instance.post('api/ykOrder/pcOrder', sss, {
      headers: {
        'content-type': 'application/x-www-form-urlencoded',
      }
    }).then((res) => {
      resolve(res)
    }).catch((err) => {
      reject(err)
    })
  })
}
export function ykOrderinfo(sss) { //是否支付
  return new Promise((resolve, reject) => {
    instance.post('api/ykOrder/info', sss, {
      headers: {
        'content-type': 'application/x-www-form-urlencoded',
      }
    }).then((res) => {
      resolve(res)
    }).catch((err) => {
      reject(err)
    })
  })
}
export function ykAuthorteachercourse(sss) { //教师课程视频
  return new Promise((resolve, reject) => {
    instance.post('api/ykAuthor/teachercourse', sss, {
      headers: {
        'content-type': 'application/x-www-form-urlencoded',
      }
    }).then((res) => {
      resolve(res)
    }).catch((err) => {
      reject(err)
    })
  })
}
export function myOrder(sss) { //订单列表
  return new Promise((resolve, reject) => {
    instance.post('api/ykUser/myOrder1', sss, {
      headers: {
        'content-type': 'application/x-www-form-urlencoded',
      }
    }).then((res) => {
      resolve(res)
    }).catch((err) => {
      reject(err)
    })
  })
}
export function myOrderremove(sss) { //取消订单
  return new Promise((resolve, reject) => {
    instance.post('api/ykOrder/remove', sss, {
      headers: {
        'content-type': 'application/x-www-form-urlencoded',
      }
    }).then((res) => {
      resolve(res)
    }).catch((err) => {
      reject(err)
    })
  })
}
export function orderedit(sss) { //确认收货
  return new Promise((resolve, reject) => {
    instance.post('api/ykOrder/edit', sss, {
      headers: {
        'content-type': 'application/x-www-form-urlencoded',
      }
    }).then((res) => {
      resolve(res)
    }).catch((err) => {
      reject(err)
    })
  })
}
export function orderinfo(sss) { //订单详情
  return new Promise((resolve, reject) => {
    instance.post('api/ykOrder/info', sss, {
      headers: {
        'content-type': 'application/x-www-form-urlencoded',
      }
    }).then((res) => {
      resolve(res)
    }).catch((err) => {
      reject(err)
    })
  })
}
export function mycourses(sss) { //我的课程
  return new Promise((resolve, reject) => {
    instance.post('api/ykGoods/mycourses', sss, {
      headers: {
        'content-type': 'application/x-www-form-urlencoded',
      }
    }).then((res) => {
      resolve(res)
    }).catch((err) => {
      reject(err)
    })
  })
}
export function ykUseredit(sss) { //修改昵称
  return new Promise((resolve, reject) => {
    instance.post('api/ykUser/edit', sss, {
      headers: {
        'content-type': 'application/x-www-form-urlencoded',
      }
    }).then((res) => {
      resolve(res)
    }).catch((err) => {
      reject(err)
    })
  })
}
export function updatePortrait(sss) { //修改图像
  return new Promise((resolve, reject) => {
    instance.post('api/ykUser/updatePortrait', sss, {
      headers: {
        'content-type': 'application/x-www-form-urlencoded',
      }
    }).then((res) => {
      resolve(res)
    }).catch((err) => {
      reject(err)
    })
  })
}
export function ykCourseCodeadd(sss) { //激活码
  return new Promise((resolve, reject) => {
    instance.post('api/ykCourseCode/add', sss, {
      headers: {
        'content-type': 'application/x-www-form-urlencoded',
      }
    }).then((res) => {
      resolve(res)
    }).catch((err) => {
      reject(err)
    })
  })
}
export function ykVideo(sss) { //课程视频列表
  return new Promise((resolve, reject) => {
    instance.post('api/ykVideo/list', sss, {
      headers: {
        'content-type': 'application/x-www-form-urlencoded',
      }
    }).then((res) => {
      resolve(res)
    }).catch((err) => {
      reject(err)
    })
  })
}
export function playMp4(sss) { //解密Base64
  return new Promise((resolve, reject) => {
    instance.post('api/video/playMp4', sss, {
      headers: {
        'content-type': 'application/x-www-form-urlencoded',
      }
    }).then((res) => {
      resolve(res)
    }).catch((err) => {
      reject(err)
    })
  })
}
//改版后
export function ykPc_list(sss) { //pc栏目设置
  return new Promise((resolve, reject) => {
    instance.post('api/ykPc/list', sss, {
      headers: {
        'content-type': 'application/x-www-form-urlencoded',
      }
    }).then((res) => {
      resolve(res)
    }).catch((err) => {
      reject(err)
    })
  })
}
export function editpassword(sss) { //修改密码
  return new Promise((resolve, reject) => {
    instance.post('api/ykUser/editpassword', sss, {
      headers: {
        'content-type': 'application/x-www-form-urlencoded',
      }
    }).then((res) => {
      resolve(res)
    }).catch((err) => {
      reject(err)
    })
  })
}
export function editphone(sss) { //修改手机号
  return new Promise((resolve, reject) => {
    instance.post('api/ykUser/editphone', sss, {
      headers: {
        'content-type': 'application/x-www-form-urlencoded',
      }
    }).then((res) => {
      resolve(res)
    }).catch((err) => {
      reject(err)
    })
  })
}

